Optimal. Leaf size=170 \[ \frac {\left (a^2+2 b^2\right ) \tanh ^{-1}(\cos (c+d x))}{16 d}+\frac {2 a b \cot (c+d x)}{5 d}+\frac {2 a b \cot ^3(c+d x)}{15 d}+\frac {\left (a^2+2 b^2\right ) \cot (c+d x) \csc (c+d x)}{16 d}+\frac {\left (a^2-2 b^2\right ) \cot (c+d x) \csc ^3(c+d x)}{24 d}-\frac {a b \cot (c+d x) \csc ^4(c+d x)}{15 d}-\frac {\cot (c+d x) \csc ^5(c+d x) (a+b \sin (c+d x))^2}{6 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.26, antiderivative size = 170, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 8, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.276, Rules used = {2968, 3127,
3110, 3100, 2827, 3852, 3853, 3855} \begin {gather*} \frac {\left (a^2+2 b^2\right ) \tanh ^{-1}(\cos (c+d x))}{16 d}+\frac {\left (a^2-2 b^2\right ) \cot (c+d x) \csc ^3(c+d x)}{24 d}+\frac {\left (a^2+2 b^2\right ) \cot (c+d x) \csc (c+d x)}{16 d}+\frac {2 a b \cot ^3(c+d x)}{15 d}+\frac {2 a b \cot (c+d x)}{5 d}-\frac {a b \cot (c+d x) \csc ^4(c+d x)}{15 d}-\frac {\cot (c+d x) \csc ^5(c+d x) (a+b \sin (c+d x))^2}{6 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2827
Rule 2968
Rule 3100
Rule 3110
Rule 3127
Rule 3852
Rule 3853
Rule 3855
Rubi steps
\begin {align*} \int \cot ^2(c+d x) \csc ^5(c+d x) (a+b \sin (c+d x))^2 \, dx &=\int \csc ^7(c+d x) (a+b \sin (c+d x))^2 \left (1-\sin ^2(c+d x)\right ) \, dx\\ &=-\frac {\cot (c+d x) \csc ^5(c+d x) (a+b \sin (c+d x))^2}{6 d}+\frac {1}{6} \int \csc ^6(c+d x) (a+b \sin (c+d x)) \left (2 b-a \sin (c+d x)-3 b \sin ^2(c+d x)\right ) \, dx\\ &=-\frac {a b \cot (c+d x) \csc ^4(c+d x)}{15 d}-\frac {\cot (c+d x) \csc ^5(c+d x) (a+b \sin (c+d x))^2}{6 d}-\frac {1}{30} \int \csc ^5(c+d x) \left (5 \left (a^2-2 b^2\right )+12 a b \sin (c+d x)+15 b^2 \sin ^2(c+d x)\right ) \, dx\\ &=\frac {\left (a^2-2 b^2\right ) \cot (c+d x) \csc ^3(c+d x)}{24 d}-\frac {a b \cot (c+d x) \csc ^4(c+d x)}{15 d}-\frac {\cot (c+d x) \csc ^5(c+d x) (a+b \sin (c+d x))^2}{6 d}-\frac {1}{120} \int \csc ^4(c+d x) \left (48 a b+15 \left (a^2+2 b^2\right ) \sin (c+d x)\right ) \, dx\\ &=\frac {\left (a^2-2 b^2\right ) \cot (c+d x) \csc ^3(c+d x)}{24 d}-\frac {a b \cot (c+d x) \csc ^4(c+d x)}{15 d}-\frac {\cot (c+d x) \csc ^5(c+d x) (a+b \sin (c+d x))^2}{6 d}-\frac {1}{5} (2 a b) \int \csc ^4(c+d x) \, dx-\frac {1}{8} \left (a^2+2 b^2\right ) \int \csc ^3(c+d x) \, dx\\ &=\frac {\left (a^2+2 b^2\right ) \cot (c+d x) \csc (c+d x)}{16 d}+\frac {\left (a^2-2 b^2\right ) \cot (c+d x) \csc ^3(c+d x)}{24 d}-\frac {a b \cot (c+d x) \csc ^4(c+d x)}{15 d}-\frac {\cot (c+d x) \csc ^5(c+d x) (a+b \sin (c+d x))^2}{6 d}-\frac {1}{16} \left (a^2+2 b^2\right ) \int \csc (c+d x) \, dx+\frac {(2 a b) \text {Subst}\left (\int \left (1+x^2\right ) \, dx,x,\cot (c+d x)\right )}{5 d}\\ &=\frac {\left (a^2+2 b^2\right ) \tanh ^{-1}(\cos (c+d x))}{16 d}+\frac {2 a b \cot (c+d x)}{5 d}+\frac {2 a b \cot ^3(c+d x)}{15 d}+\frac {\left (a^2+2 b^2\right ) \cot (c+d x) \csc (c+d x)}{16 d}+\frac {\left (a^2-2 b^2\right ) \cot (c+d x) \csc ^3(c+d x)}{24 d}-\frac {a b \cot (c+d x) \csc ^4(c+d x)}{15 d}-\frac {\cot (c+d x) \csc ^5(c+d x) (a+b \sin (c+d x))^2}{6 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.59, size = 296, normalized size = 1.74 \begin {gather*} \frac {256 a b \cot \left (\frac {1}{2} (c+d x)\right )+30 \left (a^2+2 b^2\right ) \csc ^2\left (\frac {1}{2} (c+d x)\right )+120 a^2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+240 b^2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-120 a^2 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )-240 b^2 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )-30 a^2 \sec ^2\left (\frac {1}{2} (c+d x)\right )-60 b^2 \sec ^2\left (\frac {1}{2} (c+d x)\right )+30 b^2 \sec ^4\left (\frac {1}{2} (c+d x)\right )+5 a^2 \sec ^6\left (\frac {1}{2} (c+d x)\right )-64 a b \csc ^3(c+d x) \sin ^4\left (\frac {1}{2} (c+d x)\right )+768 a b \csc ^5(c+d x) \sin ^6\left (\frac {1}{2} (c+d x)\right )-a \csc ^6\left (\frac {1}{2} (c+d x)\right ) (5 a+12 b \sin (c+d x))+\csc ^4\left (\frac {1}{2} (c+d x)\right ) \left (-30 b^2+4 a b \sin (c+d x)\right )-256 a b \tan \left (\frac {1}{2} (c+d x)\right )}{1920 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.30, size = 199, normalized size = 1.17
method | result | size |
derivativedivides | \(\frac {a^{2} \left (-\frac {\cos ^{3}\left (d x +c \right )}{6 \sin \left (d x +c \right )^{6}}-\frac {\cos ^{3}\left (d x +c \right )}{8 \sin \left (d x +c \right )^{4}}-\frac {\cos ^{3}\left (d x +c \right )}{16 \sin \left (d x +c \right )^{2}}-\frac {\cos \left (d x +c \right )}{16}-\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{16}\right )+2 a b \left (-\frac {\cos ^{3}\left (d x +c \right )}{5 \sin \left (d x +c \right )^{5}}-\frac {2 \left (\cos ^{3}\left (d x +c \right )\right )}{15 \sin \left (d x +c \right )^{3}}\right )+b^{2} \left (-\frac {\cos ^{3}\left (d x +c \right )}{4 \sin \left (d x +c \right )^{4}}-\frac {\cos ^{3}\left (d x +c \right )}{8 \sin \left (d x +c \right )^{2}}-\frac {\cos \left (d x +c \right )}{8}-\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{8}\right )}{d}\) | \(199\) |
default | \(\frac {a^{2} \left (-\frac {\cos ^{3}\left (d x +c \right )}{6 \sin \left (d x +c \right )^{6}}-\frac {\cos ^{3}\left (d x +c \right )}{8 \sin \left (d x +c \right )^{4}}-\frac {\cos ^{3}\left (d x +c \right )}{16 \sin \left (d x +c \right )^{2}}-\frac {\cos \left (d x +c \right )}{16}-\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{16}\right )+2 a b \left (-\frac {\cos ^{3}\left (d x +c \right )}{5 \sin \left (d x +c \right )^{5}}-\frac {2 \left (\cos ^{3}\left (d x +c \right )\right )}{15 \sin \left (d x +c \right )^{3}}\right )+b^{2} \left (-\frac {\cos ^{3}\left (d x +c \right )}{4 \sin \left (d x +c \right )^{4}}-\frac {\cos ^{3}\left (d x +c \right )}{8 \sin \left (d x +c \right )^{2}}-\frac {\cos \left (d x +c \right )}{8}-\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{8}\right )}{d}\) | \(199\) |
risch | \(-\frac {15 a^{2} {\mathrm e}^{11 i \left (d x +c \right )}+30 b^{2} {\mathrm e}^{11 i \left (d x +c \right )}+64 i a b -85 a^{2} {\mathrm e}^{9 i \left (d x +c \right )}+150 b^{2} {\mathrm e}^{9 i \left (d x +c \right )}-384 i a b \,{\mathrm e}^{2 i \left (d x +c \right )}-570 a^{2} {\mathrm e}^{7 i \left (d x +c \right )}-180 b^{2} {\mathrm e}^{7 i \left (d x +c \right )}-570 a^{2} {\mathrm e}^{5 i \left (d x +c \right )}-180 b^{2} {\mathrm e}^{5 i \left (d x +c \right )}+960 i a b \,{\mathrm e}^{8 i \left (d x +c \right )}-85 \,{\mathrm e}^{3 i \left (d x +c \right )} a^{2}+150 b^{2} {\mathrm e}^{3 i \left (d x +c \right )}-640 i a b \,{\mathrm e}^{6 i \left (d x +c \right )}+15 a^{2} {\mathrm e}^{i \left (d x +c \right )}+30 b^{2} {\mathrm e}^{i \left (d x +c \right )}}{120 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{6}}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{16 d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right ) b^{2}}{8 d}-\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{16 d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right ) b^{2}}{8 d}\) | \(316\) |
norman | \(\frac {-\frac {a^{2}}{384 d}+\frac {a^{2} \left (\tan ^{16}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{384 d}-\frac {\left (a^{2}+3 b^{2}\right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{96 d}+\frac {\left (a^{2}+3 b^{2}\right ) \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{96 d}-\frac {\left (5 a^{2}+6 b^{2}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{384 d}+\frac {\left (5 a^{2}+6 b^{2}\right ) \left (\tan ^{14}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{384 d}+\frac {\left (a^{2}-2 b^{2}\right ) \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64 d}+\frac {\left (a^{2}-2 b^{2}\right ) \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64 d}-\frac {a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{80 d}-\frac {11 a b \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{240 d}+\frac {17 a b \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{240 d}+\frac {5 a b \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{48 d}-\frac {5 a b \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{48 d}-\frac {17 a b \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{240 d}+\frac {11 a b \left (\tan ^{13}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{240 d}+\frac {a b \left (\tan ^{15}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{80 d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}-\frac {\left (a^{2}+2 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{16 d}\) | \(377\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 186, normalized size = 1.09 \begin {gather*} -\frac {5 \, a^{2} {\left (\frac {2 \, {\left (3 \, \cos \left (d x + c\right )^{5} - 8 \, \cos \left (d x + c\right )^{3} - 3 \, \cos \left (d x + c\right )\right )}}{\cos \left (d x + c\right )^{6} - 3 \, \cos \left (d x + c\right )^{4} + 3 \, \cos \left (d x + c\right )^{2} - 1} - 3 \, \log \left (\cos \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )} + 30 \, b^{2} {\left (\frac {2 \, {\left (\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )\right )}}{\cos \left (d x + c\right )^{4} - 2 \, \cos \left (d x + c\right )^{2} + 1} - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )} + \frac {64 \, {\left (5 \, \tan \left (d x + c\right )^{2} + 3\right )} a b}{\tan \left (d x + c\right )^{5}}}{480 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.37, size = 283, normalized size = 1.66 \begin {gather*} -\frac {30 \, {\left (a^{2} + 2 \, b^{2}\right )} \cos \left (d x + c\right )^{5} - 80 \, a^{2} \cos \left (d x + c\right )^{3} - 30 \, {\left (a^{2} + 2 \, b^{2}\right )} \cos \left (d x + c\right ) - 15 \, {\left ({\left (a^{2} + 2 \, b^{2}\right )} \cos \left (d x + c\right )^{6} - 3 \, {\left (a^{2} + 2 \, b^{2}\right )} \cos \left (d x + c\right )^{4} + 3 \, {\left (a^{2} + 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - a^{2} - 2 \, b^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 15 \, {\left ({\left (a^{2} + 2 \, b^{2}\right )} \cos \left (d x + c\right )^{6} - 3 \, {\left (a^{2} + 2 \, b^{2}\right )} \cos \left (d x + c\right )^{4} + 3 \, {\left (a^{2} + 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - a^{2} - 2 \, b^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 64 \, {\left (2 \, a b \cos \left (d x + c\right )^{5} - 5 \, a b \cos \left (d x + c\right )^{3}\right )} \sin \left (d x + c\right )}{480 \, {\left (d \cos \left (d x + c\right )^{6} - 3 \, d \cos \left (d x + c\right )^{4} + 3 \, d \cos \left (d x + c\right )^{2} - d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.48, size = 276, normalized size = 1.62 \begin {gather*} \frac {5 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} + 24 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 15 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 30 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 40 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 15 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 240 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 120 \, {\left (a^{2} + 2 \, b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + \frac {294 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} + 588 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} + 240 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 15 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 40 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 15 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 30 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 24 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 5 \, a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6}}}{1920 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 9.44, size = 245, normalized size = 1.44 \begin {gather*} \frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6}{384\,d}-\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{128\,d}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (\frac {a^2}{16}+\frac {b^2}{8}\right )}{d}-\frac {{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (\frac {a^2}{6}-\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{2}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {a^2}{2}+b^2\right )+\frac {4\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{3}-8\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\frac {4\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{5}\right )}{64\,d}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (\frac {a^2}{128}+\frac {b^2}{64}\right )}{d}+\frac {a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{48\,d}+\frac {a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{80\,d}-\frac {a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________